fix: normalize binary cache path so the save step works#7
Merged
Conversation
go run . recompiled the tool on every invocation (~15s) and setup-go's module cache never worked: its cache-dependency-path is the action's go.sum under _actions/, outside GITHUB_WORKSPACE, so the cache key could not resolve. Build the binary once and cache it keyed on a content hash of the Go sources (correct for both SHA-pinned consumers and the repo's own uses: ./ self-invocation), skipping Go setup and compilation on a cache hit.
github.action_path ends in /. for local (uses: ./) invocation, so the
cache path contained /./ and actions/cache rejected it as an invalid
pattern in the post save step ("Relative pathing '.' and '..' is not
allowed"), silently skipping the save so the cache never populated.
Derive a normalized absolute path with pwd -P for the cache path input.
|
Ready to review this PR? Stage has broken it down into 2 individual chapters for you:
Chapters generated by Stage for commit 8faabdb on Jun 25, 2026 10:43am UTC. |
…alize # Conflicts: # action.yml
Contributor
Change file check✅ OK — 2 valid change file(s) added in this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The binary cache added in #6 never populated. The post-save step failed with:
For
uses: ./(this repo's ownrelease/check-changesself-invocation),github.action_pathends in/., so${{ github.action_path }}/release-toolcontained/./, whichactions/cacherejects. The restore just reported a miss, so it looked like caching simply never worked.Fix
Derive a normalized absolute path with
pwd -Pin the hash step and use it as the cachepath. Build output and the run binary already resolve to the same physical file, so only the cachepathinput needed the clean form. External SHA-pinned consumers were unaffected (no trailing/.), but this makes it correct everywhere.Testing
action.ymlvalidated as YAML.pwd -Pfrom the action dir yields a clean path with no/./.Next version: 1.6.0against the Firmware repo.